<script>
  $(document).ready(function(){
         var mod_del = $("#mod_del").val();
         if(mod_del==1){
              alert('此型号下还有资料种类，此型号不可以删除');
         }
  })
</script>
		<div id="center-column">
			<div class="top-bar">
				<a href="<?php echo  base_url();?>model/model_add" class="button">新增</a>
				<h1>Contents</h1>
				<div class="breadcrumbs"><a href="#">首页</a> / <?php echo anchor('model/index','型号管理');?></div>
			</div><br />
		  <div class="select-bar">
		    <label>
		    <input type="text" name="textfield" />
		    </label>
		    <label>
			<input type="submit" name="Submit" value="Search" />
			</label>
		  </div>
			<div class="table">
				<input type="hidden" value="<?php echo $mod_del;?>" id="mod_del" >
				
				<table class="listing" cellpadding="0" cellspacing="0">
					<tr>
						<th class="first" width="22">ID</th>
						<th>型号</th>
						<th>描述</th>
						<th class="last">操作</th>
					</tr>
			    <?php foreach($mod as $k=>$val):?>		
					<tr>
                        <td><?php echo $start;?></td>
                        <td><?php echo $val->name;?></td>
                        <td><?php echo substr_zh($val->des,'20');?></td>
                        <td><?php echo anchor('model/model_detail/'.$val->mod_id,'查看',array('class'=>'mod_detail'));?>&nbsp;&nbsp;|&nbsp;&nbsp;<?php echo anchor('model/model_edit/'.$val->mod_id,'编辑',array('class'=>'mod_edit'));?>&nbsp;&nbsp;|&nbsp;&nbsp;<?php echo anchor('model/model_del/'.$val->mod_id,'删除',array("class"=>"mod_edit","onclick"=>"return confirm('您确定要删除吗？')?true:false;"));?></td>
					</tr>
				<?php $start++;endforeach;?>						
				
				</table>
				<?php echo $page;?>
			</div>
		</div>
	</div>
	<div id="footer"></div>
</div>


</body>
</html>
